package designpattern.command.ricecooker;

import java.util.ArrayList;
import java.util.List;

public class RiceCookerInvoker {
    private final List<IRiceCookerCmd> cmds = new ArrayList<>();
    public void addCmd(IRiceCookerCmd riceCookerCmd){
        cmds.add(riceCookerCmd);
    }
    public void executeCmd(){
        cmds.forEach(IRiceCookerCmd::execute);
        cmds.clear();
    }
}
